//
//  DataBaseSimple.h
//  侧滑Demo
//
//  Created by 毛志 on 14-7-2.
//  Copyright (c) 2014年 maozhi. All rights reserved.
//

#import <Foundation/Foundation.h>

#import "Viewroom.pb.h"
#import "ViewOrderModel.h"

@interface  DataBaseOrder: NSObject


@property(nonatomic,strong)UIAlertView *alertView;

-(id) initWithDB:(NSString *)fileName;

/**
 *  创建表
 */
- (void)createTable;
/**
 *  删除表
 */
- (void)dropTable;


/**
 *  插入
 *
 *  @param array          ViewOrderModelArray
 *  @param useTransaction 是否用事务型
 */
- (void)insertDBwithViewOrderModelArray:(NSArray *)array useTransaction:(BOOL)useTransaction;
/**
 *  删除
 *
 *  @param key orderID
 */
- (void)deleteDBwithStatus:(NSString *)statusStr;


- (void)deleteWithId:(int)orderId;

/**
 *  删除所有
 */
- (void)deleteAll;
/**
 *  更新
 *
 *  @param key   orderID
 *  @param model ViewOrderModel
 */
- (void)updateDBwithKey:(UInt64)orderID withModel:(ViewOrderModel *)model;
/**
 *  查询获取
 *
 *  @param status  status
 *
 *  @return 返回资料
 */
- (NSArray *)selectDBwithStatus:(NSString *)statusStr;

- (NSArray *)selectAll;

-(void) close;

@end
